/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.ac.bath.domains.prey;

import java.util.Collection;
import java.util.Vector;
import uk.ac.bath.base.Cell;
import uk.ac.bath.base.MachineFactoryIF;
import uk.ac.bath.base.MachineIF;
import uk.ac.bath.machine.bool.LogicalMachine;
import uk.ac.bath.machine.bool.Palettes;
import uk.ac.bath.util.MyRandom;
import uk.ac.bath.util.Tweakable;
import uk.ac.bath.util.TweakableInt;

/**
 *
 * @author pjl
 */
public class CellFactory {

    Collection<Tweakable> tweaks=new Vector<Tweakable>();

//    public  TweakableInt initFit =
//            new TweakableInt(tweaks, 0, 2000000000, 50000, "InitialFitness");

    private MachineFactoryIF factory;

    public Collection<Tweakable> getTweaks() {
        return tweaks;
    }

    public CellFactory(MachineFactoryIF factory) {
        this.factory=factory;
        tweaks.addAll(factory.getTweaks());
    }

    public HunterCell createRandomHunterCell(MyPoint p) {

        int cid = Cell.nextId();
        String tag = "Hunter:" + cid;
        MachineIF m=factory.createMachine();
        return new HunterCell(m, p, tag);
    }

    public PreyCell createRandomPreyCell(MyPoint p) {

      
        MachineIF m=factory.createMachine();
        int cid = Cell.nextId();
        String tag = "Prey:" + cid;

        return new PreyCell(m, p, tag);
    }
}
